<?php

namespace app\common\model\Subject\Teacher;

use think\Model;

// 名师粉丝模型
class Follow extends Model
{
    protected $name = 'subject_teacher_follow';
    protected $autoWriteTimestamp = true;
    protected $createTime = 'createtime';
    protected $updateTime = false;

    // 连表查询名师信息
    public function teacher()
    {
        return $this->belongsTo(
            'app\common\model\Subject\Teacher\Teacher',
            'teacherid',
            'id',
            [],
            'LEFT'
        )->setEagerlyType(0);
    }

    // 连表查询粉丝信息
    public function business() {
        return $this->belongsTo('app\common\model\Business\Business', 
        'busid', 
        'id', 
        [], 
        'LEFT')->setEagerlyType(0);
    }

}
